var pageii = null;
var grid = null;
$(function() {
	
	grid = lyGrid({
		pagId : 'paging',
		l_column : [ {
			colkey : "patient_number",
			name : "编号",
		}, {
			colkey : "patient_name",
			name : "姓名",
			isSort:true,
		}, {
			colkey : "patient_sex",
			name : "性别",
			isSort:true,
		}, {
			colkey : "patient_age",
			name : "年龄"
		}, {
			colkey : "patient_phone",
			name : "手机号码",
		}, {
			colkey : "patient_address",
			name : "患者地址",
		}, {
			colkey : "create_time",
			name : "创建日期",
			isSort:true,
			renderData : function(rowindex, data, rowdata, column) {
				if (data == null || data == undefined || data == '') { 
					return "无";
				} else {
					return new Date(data).format("yyyy-MM-dd");
				}
			}
		}, {
			colkey : "update_time",
			name : "修改日期",
			isSort:true,
			renderData : function(rowindex,data, rowdata, column) {
				if (data == null || data == undefined || data == '') { 
					return "无";
				} else {
					return new Date(data).format("yyyy-MM-dd");
				}
			}
		}],
		data : {'patientFormMap.type':'day'},
		jsonUrl : rootPath + '/patient/findByPage.shtml',
		checkbox : true,
		serNumber : true
	});
	$("#search").click("click", function() {// 绑定查询按扭
		var searchParams = $("#searchForm").serializeJson();// 初始化传参数
		grid.setOptions({
			data : searchParams
		});
	});
});

function getseldata(){
	var cbox = grid.getSelectedCheckbox();
	if (cbox.length > 1 || cbox == "") {
		layer.msg("只能选中一个");
		return;
	}
	return grid.selectRow(); 
}


